package jhunter.web.mvc.resource;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.util.AntPathMatcher;

public class ResourceMappingHandler {

	private AntPathMatcher antPathMatcher = new AntPathMatcher();

	private String[] patterns = new String[] { "/static/**" };

	public boolean match(String uri) {
		for (String patten : patterns) {
			if (antPathMatcher.match(patten, uri)) {
				return true;
			}
		}
		return false;
	}

	public boolean handler(HttpServletRequest request, HttpServletResponse response) throws IOException {
		String uri = request.getRequestURI();
		if (match(uri)) {
			
			return true;
		}
		return false;
	}

}
